package com.earnings.okhttputils.utils.car.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by Administrator on 2017/6/20 0020.
 */

public class CalculatorAdapter extends FragmentPagerAdapter {
    private ArrayList<Fragment> fragments;

    public CalculatorAdapter(FragmentManager fm, ArrayList<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        if (position == 0) return "全款";
        if (position == 1) return "贷款";
        return super.getPageTitle(position);
    }
}
